package com.fjut.wx.controller;


import com.fjut.model.activity.CouponInfo;
import com.fjut.service.CouponInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "微信优惠券接口")
@RestController
@RequestMapping("/fjut/activity/couponInfo")
public class CouponInfoApiController {

    @Autowired
    private CouponInfoService couponInfoService;

    @ApiOperation("根据优惠券id查询优惠券")
    @GetMapping("getClientCouponById/{id}")
    public CouponInfo getClientCouponById(@PathVariable("id") Long id){
        return couponInfoService.getById(id);
    }

    @ApiOperation("更新优惠券")
    @GetMapping("updateClientCouponStatus/{couponUseId}/{orderId}")
    public Boolean updateClientCouponInfo(@PathVariable("couponUseId") Long couponUseId, @PathVariable("orderId") Long orderId){
        return couponInfoService.updateCouponInfo(couponUseId,orderId);
    }
}
